package tetris;

import static org.junit.Assert.*;

import java.awt.event.ActionListener;

import javax.swing.Timer;

import org.junit.Test;

import tetris.Form.Tetrominoes;

public class GamePanelTest {

	@Test
	public void testGamePanel() {
		 GamePanel table = new GamePanel(null);
         int h = table.BoardHeight;
         int w = table.BoardWidth;
         int k = table.curX;
         int l = table.curY;
         
         assertTrue(h==19);
         assertTrue(w==9);
         assertFalse(table.isFallingFinished);
         assertFalse(table.isPaused);
         assertFalse(table.isStarted);
         assertFalse(table.isGameOver);
         
         assertTrue( k == 0 && l ==0);
         
         assertTrue(table.isFocusable());
         try{
        	 
           Form curPiece = new Form();
  	       Timer timer = new Timer(400, (ActionListener) this);
  	       timer.start(); 
         }
         catch(Exception e){
        	 
         }
	}

	@Test
	public void testActionPerformed() {
		
		GamePanel table = new GamePanel(null);
		assertTrue(table.isFallingFinished);
	}

	@Test
	public void testSquareWidth() {
		fail("Not yet implemented");
	}

	@Test
	public void testSquareHeight() {
		fail("Not yet implemented");
	}

	@Test
	public void testShapeAt() {
		fail("Not yet implemented");
	}

	@Test
	public void testStart() {
		
		GamePanel table = new GamePanel(null);
		assertFalse(table.isPaused);
		assertTrue(table.isStarted);
		assertFalse(table.isFallingFinished);
		
		/*try{
			clearBoard();
		    newPiece();
			
		}
		catch(Exception e){
			
		}
		*/
	}

	@Test
	public void testPause() {
		GamePanel table = new GamePanel(null);
		assertTrue(table.isStarted);
	}

	@Test
	public void testPaintGraphics() {
		fail("Not yet implemented");
	}

	@Test
	public void testSaveScore() {
		GamePanel table = new GamePanel(null);
		
		assertTrue(table.isGameOver);
		try{
		
			ScoresSystem sm = new ScoresSystem();
		}
		catch(Exception e){
			
		}
			

	}

}
